To access Windows environment variables from within Ruby, use:
ENV['USERNAME']  =>  "Bruce Tesar"
ENV['RUBOT'] = "C:\\Program Files\\RUBOT\\BBT 6_17\\bin"

NOTE: setting an environment variable from within Ruby only holds
for the current Ruby process; it does not propagate to the larger
system, let alone hold permanently.

To access Windows environment variables in Windows, use:

SET  => <lists all variables and values>
SET USERNAME  => USERNAME=Bruce Tesar
SET USERNAME=Gordon Gekko  => <sets the variable USERNAME to Gordon Gekko>

Again, this setting only holds for the current shell process;
it isn't permanent.

===========================================================================
MSDN VB

Environ(<name of env var as string>)
returns the string assigned to that variable, or "" if the variable isn't found.

=======================================================
setx.exe is a resource kit program that will permanently set an
environment variable from the command line.
Downloaded from Microsoft as part of Support Tools.
Command line:
setx RUBOT "C:\Program Files\Rubot\bin"

It appears that you must reboot in order for the change
to be visible to VB/Excel.
